.fx-radio {
  display: inline-flex;
  justify-content: flex-start;
  align-items: center;
  margin-right: 10px;
  user-select: none;
  cursor: pointer;
  transition: transform .15s ease-in;
  color: $font-color-default;

  &:hover > .fx-radio-select-box {
    border-color: $radio-active-background;
  }

  &.active {
    color: $radio-active-background;

    &.disabled {
      > .fx-radio-select-box {
        background-color: $color-disabled-background !important;
        border-color: $color-disabled-color !important;
      }
    }

    > .fx-radio-select-box {
      background-color: $radio-active-background;
      border-color: $radio-active-background;

      &::after {
        transform: translate(-50%, -50%) scale(1);
      }
    }
  }

  &.disabled {
    cursor: not-allowed !important;
    color: $color-disabled-color !important;

    &:hover {
      > .fx-radio-select-box {
        border-color: $color-disabled-color;
      }
    }
  }

  &.border {
    padding: 0 20px 0 10px;
    border: 1px solid $border-color-default;
    background-color: $radio-border-background;
    border-radius: $border-radius-default;

    &.active {
      border-color: $radio-border-active-color;
    }

    &.disabled {
      border-color: $color-disabled-color;
    }

    &.large {
      height: $height-large;
      line-height: $height-large;
    }

    &.middle {
      height: $height-middle;
      line-height: $height-middle;
    }

    &.default {
      height: $height-default;
      line-height: $height-default;
    }

    &.mini {
      height: $height-mini;
      line-height: $height-mini;
    }
  }

  > .fx-radio-select-box {
    display: inline-block;
    border: 1px solid $font-color-lowest;
    border-radius: 50%;
    width: 14px;
    height: 14px;
    background-color: $color-white;
    position: relative;
    box-sizing: border-box;

    &::after {
      content: "";
      display: inline-block;
      width: 4px;
      height: 4px;
      border-radius: 100%;
      background-color: $color-white;
      position: absolute;
      left: 50%;
      top: 50%;
      z-index: 10;
      transform: translate(-50%, -50%) scale(0);
      transition: transform .15s ease-in;
    }
  }

  > .fx-radio-label {
    padding-left: 5px;
  }
}

.fx-radio-button {
  user-select: none;
  cursor: pointer;
  display: inline-block;
  background-color: $radio-button-background;
  border-right: 1px solid $border-color-default;
  transition: all 0.15s ease-in;
  color: $font-color-default;

  &:last-of-type {
    border-right: none;
  }

  &:hover {
    color: $radio-button-hover-font-color;
  }

  &.active {
    background-color: $radio-button-active-background;
    color: $color-white;
  }

  &.disabled {
    cursor: not-allowed;
    color: $color-disabled-color;

    &.active {
      background-color: $color-disabled-color;
      color: $color-white;
    }
  }

  &.large {
    height: $height-large;
    line-height: $height-large;
    padding: 0 20px;
  }

  &.middle {
    height: $height-middle;
    line-height: $height-middle;
    padding: 0 20px;
  }

  &.default {
    height: $height-default;
    line-height: $height-default;
    padding: 0 15px;
  }

  &.mini {
    height: $height-mini;
    line-height: $height-mini;
    padding: 0 15px;
  }
}

.fx-radio-group {
  display: inline-flex;
  justify-content: flex-start;
  align-items: center;

  &.button-group {
    border: 1px solid $border-color-default;
    border-radius: $border-radius-default;
    overflow: hidden;
  }
}
